/*
 * Copyright (c) 2018. paascloud.net All Rights Reserved.
 * 项目名称：paascloud快速搭建企业级分布式微服务平台
 * 类名称：OperationLogDto.java
 * 创建人：刘兆明
 * 联系方式：paascloud.net@gmail.com
 * 开源地址: https://github.com/paascloud
 * 博客地址: http://blog.paascloud.net
 * 项目官网: http://paascloud.net
 */

package com.hyacinth.dto;

import com.hyacinth.util.validator.annotation.FieldMeta;
import com.hyacinth.util.validator.constraints.Included;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import org.springframework.http.HttpStatus;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;


/**
 * 日志传输对象
 */
@Data
@NoArgsConstructor
public class OperationLogDto implements Serializable {

    private static final long serialVersionUID = 1L;

    //---------------------必填字段--------------------
    @FieldMeta(name = "日志类型")
    @NotBlank
    @Included({"01", "02", "03", "04"})
    private String logType;
    @FieldMeta(name = "请求地址")
    @NotBlank
    private String requestUrl;
    @FieldMeta(name = "类名")
    @NotBlank
    private String className;
    @FieldMeta(name = "请求地址")
    @NotBlank
    private String methodName;
    @FieldMeta(name = "开始时间")
    @NotNull
    private Date startTime;
    @FieldMeta(name = "结束时间")
    @NotNull
    private Date endTime;
    @FieldMeta(name = "耗时/毫秒")
    @NotNull
    private Long delayTime;
    @FieldMeta(name = "响应码", value = "200")
    private Integer retCode;
    //--------------------可选字段---------------------
    @FieldMeta(name = "日志类型名称")
    @Length(max = 10)
    private String logName;
    @FieldMeta(name = "权限编码")
    private String authCode;
    @FieldMeta(name = "操作系统")
    private String os;
    @FieldMeta(name = "浏览器类型")
    private String browser;
    @FieldMeta(name = "IP地址")
    private String ip;
    @FieldMeta(name = "操作位置")
    private String location;
    @FieldMeta(name = "物理地址")
    private String mac;
    @FieldMeta(name = "详细描述")
    private String desc;
    @FieldMeta(name = "请求参数")
    private String requestData;
    @FieldMeta(name = "响应结果")
    private String responseData;
    @FieldMeta(name = "报错信息")
    private String retMsg;
    @FieldMeta(name = "创建人")
    private String creator;
    @FieldMeta(name = "创建人编码")
    private String creatorCode;
    @FieldMeta(name = "创建时间")
    private Date createdTime;
    @FieldMeta(name = "最近操作人")
    private String lastOperator;
    @FieldMeta(name = "最后操作人编码")
    private String lastOperatorCode;
    @FieldMeta(name = "更新时间")
    private Date updateTime;

}